In this section (Genesis 6:5-6) we see a huge contrast: men's hearts are described as exceedingly evil, while God's heart is painfully grieved. He is sorry at "how great man's wickedness on the earth had become, and that every inclination of the thoughts of his heart was only evil all the time.'' God's resulting decision is to blot out all living things through a flood and begin again with Noah.
An interesting parallel is found in Exodus 32. God determines to destroy the nation of Israel and begin again with Moses. However, in this situation, God relented through Moses' intercession.